<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title></title>
    <%@include file="/WEB-INF/pages/common/basic-styles.jspf" %>
</head>
<body>
    <form:form method="post" commandName="child" cssClass="form-horizontal" 
    			onsubmit="return save()" cssStyle="padding-top:20px;">
        <form:hidden path="id"/>
        <form:hidden path="available"/>
        <form:hidden path="parentId"/>
        <form:hidden path="parentIds"/>

        <div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="name"> 父节点名称 </label>
			<div class="col-sm-9">
				<input type="text" class="col-xs-10 col-sm-5" value="${parent.name }" readonly="readonly"/>
			</div>
		</div>
		<div class="space-4"></div>

		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="name"> 子节点名称 </label>
			<div class="col-sm-9">
				<form:input path="name" class="col-xs-10 col-sm-5" />
			</div>
		</div>
		<div class="space-4"></div>

		<div class="clearfix" style="padding-left: 80px;">
			<div class="col-md-offset-3 col-md-3">
				<form:button class="btn btn-sm btn-primary"><i class="icon-ok bigger-110"></i>新增子节点</form:button>
				&nbsp; &nbsp; &nbsp;
				<button class="btn btn-sm " type="button" onclick="javascript:history.go(-1);"><i class="icon-off bigger-110"></i>关闭</button>
			</div>
		</div>
    </form:form>
    
    <%@include file="/WEB-INF/pages/common/basic-scripts.jspf" %> 
    <script>
    	function save() {
    		var name = $("#name").val();
        	if (isEmpty(name)) {
        		defaultAlert("节点名称不能为空");
        		return false;
        	}
        	loading();
        	return true;
    	}
    </script>
</body>
</html>